﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Car : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Binddate();

        }
    }
    protected void Binddate()
    {
        users us = new users();
      //  GridView1.DataSource = us.Getone(us);
       
    

    }
    protected void btnL_Click(object sender, EventArgs e)
    {
        string name = tbx_uname.Text.Trim();
        string number = txtnu.Text.Trim();
        string tel = TextBox3.Text.Trim();
        string te = TextBox5.Text.Trim();
        string pss = TextBox6.Text.Trim();
        string penson = TextBox4.Text.Trim();
        string type = TextBox7.Text.Trim();

        users tmp = new users();
        tmp.name = name;
        tmp.number = number;
        tmp.tel = tel;
        tmp.rte = te;
        tmp.tte = pss;
        tmp.penson = penson;
        tmp.type = type;

        int result = tmp.yuding(tmp);
        if (result > 0)
        {
            Response.Write("<script>alert(\"预定成功！\")</script>");
           
            Binddate();
        }
    }
    protected void btnq_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/用户.aspx");
    }

   
}